Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stimulus] Fasten lazy loading + add debug lazy:loading and lazy:loaded #2463

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

smnandre
Copy link
Member

Q A
Bug fix? no
New feature? yes
Issues Fix #...
License MIT

This PR..

  1. improves the controller lazy loading by tuning algorithm (early exit, remove await, ...)

  2. introduces two new debug events in the console to ease DX with lazy controllers

    • my-controller#lazy:loading when the lazy controller is detected in the DOM
    • my-controller#lazy:loaded after the file has been downloaded and imported

I would really like some feedback / tests IRL (especially with Webpack i'm not used to)

@carsonbot carsonbot added Feature New Feature Status: Needs Review Needs to be reviewed labels Dec 22, 2024
@smnandre smnandre requested review from Kocal and kbond December 22, 2024 02:40
Copy link

github-actions bot commented Dec 22, 2024

📊 Packages dist files size difference

ℹ️ No difference in dist packagesFiles.

@Kocal
Copy link
Member

Kocal commented Dec 22, 2024

I would really like some feedback / tests IRL (especially with Webpack i'm not used to)

I will try to find some time to rebuild a Symfony + Encore app, but by reading your changes it looks fine to me (feel free to reping me if necessary)

@smnandre
Copy link
Member Author

@MatTheCat ? 👼

@Kocal
Copy link
Member

Kocal commented Dec 22, 2024

I'm testing

@Kocal
Copy link
Member

Kocal commented Dec 22, 2024

Well... I've just realized, but to use Stimulus in a Symfony App with Webpack Encore, we use the https://github.com/symfony/stimulus-bridge ... which is not in this repository (and so not modified by this PR) 😅

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Dec 22, 2024
@smnandre
Copy link
Member Author

Well.... let me tell you i have no intention of coding in the Bridge hahaha

(i'll have a look but the lazy loading is done differently if i remember correctly)

@MatTheCat
Copy link
Contributor

I’ve got nothing to test then? 🤔

@smnandre smnandre requested review from kbond and removed request for kbond January 16, 2025 00:17
@carsonbot carsonbot added Status: Needs Review Needs to be reviewed and removed Status: Reviewed Has been reviewed by a maintainer labels Jan 16, 2025
@Kocal Kocal force-pushed the stimulus/lazy-loader branch from 0e5abca to 3b8e1ce Compare January 16, 2025 21:55
@Kocal
Copy link
Member

Kocal commented Jan 16, 2025

Thanks Simon.

@Kocal Kocal merged commit f1b645e into symfony:2.x Jan 16, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants